package cn.sixmillions.demo01.entity;

/**
 * 学生
 */
public class Student {

    /**
     * 学生id
     */
    private Integer id;

    /**
     * 姓名
     */
    private String name;

    /**
     * 性别
     */
    private Boolean male;

    /**
     * 班级
     */
    private Clazz clazz;

    public Student() {
        System.out.println("student无参构造");
    }

    public Student(Integer id, String name, Boolean male) {
        System.out.println("student有参构造(三个参数)");
        this.id = id;
        this.name = name;
        this.male = male;
    }

    public Student(Integer id, String name, Boolean male, Clazz clazz) {
        System.out.println("student有参构造");
        this.id = id;
        this.name = name;
        this.male = male;
        this.clazz = clazz;
    }

    public void say() {
        System.out.println(String.format("我是%s， 我的班级是%s，班级信息是%s", this.name, this.clazz.getName(), this.clazz.getDesc()));
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getMale() {
        return male;
    }

    public void setMale(Boolean male) {
        this.male = male;
    }

    public Clazz getClazz() {
        return clazz;
    }

    public void setClazz(Clazz clazz) {
        System.out.println("setClazz");
        this.clazz = clazz;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", male=" + male +
                ", clazz=" + clazz +
                '}';
    }
}
